<!DOCTYPE html>
<html>
<head>
    <title>我的订单</title>  <link rel="icon" href="/template/pc1/images/wmh_favicon.ico" type="image/x-icon" />
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <script type="text/javascript" src="https://static.9hive.cn/global/vendor/jquery/jquery-2.1.4.min.js"></script>
    <script type="text/javascript" src="/template/default/mobile/script/bootstrap.min.js"></script>
    <link rel="stylesheet" type="text/css" href="/template/default/css/public.css"/>
    <link rel="stylesheet" type="text/css" href="/template/default/css/index.css"/>
    <link type="text/css" rel="stylesheet" href="/template/default/mobile/style/bootstrap.css">
    <link type="text/css" rel="stylesheet" href="/template/default/mobile/style/common.mobile.css">
    <link type="text/css" rel="stylesheet" href="/template/default/mobile/style/style.css">
    <!--dropload-->
    <script type="text/javascript" src="/res/plugins/dropload/js/dropload.min.js"></script>
    <link type="text/css" rel="stylesheet" href="/res/plugins/dropload/css/dropload.css"/>
    <style type='text/css'>
        .my_nav ul {
            display: box;
            display: -ms-box;
            display: -webkit-box;
            display: flex;
            display: -ms-flexbox;
            display: -webkit-flex
        }

        .my_nav li {
            display: block;
            flex: 1;
            -ms-flex: 1;
            -webkit-flex: 1;
            box-flex: 1;
            -ms-box-flex: 1;
            -webkit-box-flex: 1
        }

        .my_nav a:before {
            content: '\20';
            display: block
        }

        .layer .action a, .order_head .oh_btn.bg_1 {
            background: #F3F3F3;
            color: #fff;
            border: 1px solid transparent
        }

        .my_nav {
            width: 100%;
            background: #fff;
        }

        .my_nav ul {
            overflow: hidden
        }

        .my_nav a {
            position: relative;
            display: block;
            line-height: 49px;
            text-align: center;
            color: #666;
            padding-bottom: 2px;
            font-size: 14px
        }

        .my_nav li.cur > a {
            padding-bottom: 0;
            border-bottom: 1px solid #E50001;
            color: #E50001 !important;
        }

        a:active, a:hover {
            text-decoration: none;
        }

        .btn-success {
            background-color: #5cb85c;
            color: white
        }
    </style>
</head>
<body style="padding-top:0px;margin:0 auto;">
<div class="main">
    <div class="my_nav">
        <ul id="nav">
            <li
            <%if(type=="qbdd"){%> class="cur" <%}%>><a
                href="/b/order/orderListForm?shopId=${shopId!}&type=qbdd">全部</a></li>
            <li
            <%if(type=="dfk"){%> class="cur" <%}%>><a
                href="/b/order/orderListForm?shopId=${shopId!}&type=dfk">待付款</a></li>
            <li
            <%if(type=="dfh"){%> class="cur" <%}%>><a
                href="/b/order/orderListForm?shopId=${shopId!}&type=dfh">待发货</a></li>
            <li
            <%if(type=="dsh"){%> class="cur" <%}%>><a
                href="/b/order/orderListForm?shopId=${shopId!}&type=dsh">待收货</a></li>
            <li
            <%if(type=="dpj"){%> class="cur" <%}%>><a
                href="/b/order/orderListForm?shopId=${shopId!}&type=dpj">待评价</a></li>
            <li
            <%if(type=="thh"){%> class="cur" <%}%>><a
                href="/b/order/orderListForm?shopId=${shopId!}&type=thh">退换货</a></li>
        </ul>
    </div>
    <%if(isEmpty(loginMember)){%>
    <div class="myoder" style='text-align:center;color:#aaa;padding:30px;'>
        您暂时没有任何订单!
    </div>
    <%}%>
    <div style='margin-bottom:40px;' class="content">
        <ul class="lists">

        </ul>
    </div>
    <%include("footer_sys.html"){}%>
</body>
<script>
    $(function () {

        // 页数
        var page = 0;
        // 每页展示5个
        var size = 10;
        // dropload
        $('.content').dropload({
            scrollArea: window,
            loadDownFn: function (me) {
                page++;
                // 拼接HTML
                var result = '';
                $.ajax({
                    type: 'GET',
                    url: '/b/order/ajaxOrderList',
                    data: {
                        "pageNumber": page,
                        "pageSize": size,
                        "type": "${type}",
                        "shopId": "${shopId!}"

                    },
                    success: function (r) {
                        console.log(r.data.length);
                        if (r.data.length > 0) {

                            //alert(eval(r.data.pager.list[0].productImageListStore)[0].bigProductImagePath);
                            $.each(r.data, function (k, v) {

                                result += '';
                                result += '<ul>';
                                result += '<div class="myoder">';
                                result += '<div class="myoder-hd">';
                                result += '<span class="pull-left">订单编号：' + v.orderSn + '</span>';
                                result += '<span class="pull-right">' + v.createDate + '';
                                result += '<span class="text-warning" >[' + v.status + ']</span>';//订单状态.....
                                result += '</span>';
                                result += '</div>';
                                result += '<div class="myoder-detail">';

                                $.each(v.products, function (k0, v0) {
                                    if (v.products.length <= 1) {
                                        result += '<a href="/b/product/detailWap?id=' + v0.id + '&shopId=${shopId!}">';
                                        result += '<img src=' + eval(v0.productImageListStore)[0].sourceProductImagePath + ' width="160">';
                                        result += '</a>';
                                        result += '<div class="pull-left"><div class="name"><a href="/b/product/detailWap?id=' + v0.id + '&shopId=${shopId!}">' + v0.name + '</a></div></div>';
                                    } else {
                                        result += '<a href="/b/product/detailWap?id=' + v0.id + '&shopId=${shopId!}">';
                                        result += '<img src=' + eval(v0.productImageListStore)[0].sourceProductImagePath + ' width="160">';
                                        result += '</a>';
                                    }

                                });
                                result += '</div>';
                                result += '<div class="myoder-total">';
                                result += '<span>共计：<span class="false">' + v.totalAmount + '元</span></span>';
                                if (v.type == 'dpj') {
                                    result += '<a href="/b/order/evaluateEdit?id=' + v.orderId + '&shopId=${shopId!}" class="btn btn-success pull-right btn-sm" >评价订单</a>';
                                } else {
                                    result += '<a href="/b/order/view?id=' + v.orderId + '&shopId=${shopId!}" class="btn btn-success pull-right btn-sm" >订单详情</a>';
                                }
                                if (v.type == 'dsh') {
                                    result += '<a href="/b/order/getLogisticsInfo?id=' + v.orderId + '&shopId=${shopId!}" class="btn btn-success pull-right btn-sm" >物流</a>';
                                }

                                result += '</div>';
                                result += '</div>';

                            })
                        } else {
                            // 锁定
                            me.lock();
                            // 无数据
                            me.noData();
                        }
                        // 为了测试，延迟1秒加载
                        setTimeout(function () {
                            // 插入数据到页面，放到最后面
                            $('.lists').append(result);
                            // 每次数据插入，必须重置
                            me.resetload();
                        }, 10);
                    },
                });
            }
        });
    });
</script>
</html>

